package cn.wolfcode.ssm.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class BusinessReportQueryObject extends QueryObject {
    private String groupType = "b.name";
    private Long businessId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private Integer status;
    private Boolean anoType;
    //由于传进来最小为日，导致部分数据无法显示
    //使用工具类将结束时间设为当天的23时59分59秒
    public Date getEndDate(){
        if(endDate==null){
            return null;
        }
        return DateUtil.endOfDay(endDate);
    }


}
